<include file="public@header" />
<link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css">
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('expenses/index')}">支出列表</a></li>
			<li class="active"><a href="{:url('expenses/add')}">添加支出</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20 layui-form" action="{:url('expenses/edit')}">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required"></span>关联合同
				</label>
				<div class="col-md-3 col-sm-6">
					<select class="form-control" name="contract_id" lay-search="">
			          	<option value="">请选择合同</option>
			          	<foreach name="contract_list" item="vo">
			          		<option value="{$vo.id}" <if $vo.id == $row.contract_id>selected</if> >{$vo.customer.name} | {$vo.contract_no}</option>
			          	</foreach>
			        </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>支出金额
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="text" class="form-control" name="amount" value="{$row.amount}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>支付日期
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="text" class="form-control js-bootstrap-date" name="date" value="{$row.date}" autocomplete="off">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required"></span>支出备注
				</label>
				<div class="col-md-3 col-sm-10">
					<input type="text" class="form-control" name="remark" value="{$row.remark}">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$row.id}">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['form'], function(){
			var form = layui.form;
		});
	</script>
</body>
</html>